package com.feri.ssm.service.impl;

import com.feri.ssm.dao.AdminDao;
import com.feri.ssm.entity.Admin;
import com.feri.ssm.service.intf.AdminService;
import com.feri.ssm.vo.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    private AdminDao dao;

    //注册
    @Override
    public R add(Admin admin) {
        if (dao.addOne(admin)>0){
            return R.ok();
        }else {
            return R.fail();
        }
    }

    @Override
    public void login(String name, String password) {
        dao.findOne(name, password);
    }

}
